package cn.aitrox.ry.service.anno.api;

import cn.aitrox.ry.bean.CommonPageInfo;
import cn.aitrox.ry.bean.RespResult;
import cn.aitrox.ry.service.anno.dto.task.TaskDto;
import cn.aitrox.ry.service.anno.dto.task.TaskDetailDto;
import cn.aitrox.ry.service.anno.dto.task.in.AnnoSeriesDto;
import cn.aitrox.ry.service.anno.dto.task.in.TaskCreateInDto;
import cn.aitrox.ry.service.anno.dto.task.in.TaskEditInDto;
import cn.aitrox.ry.service.anno.dto.task.in.TaskNameExistedInDto;
import cn.aitrox.ry.service.anno.dto.task.in.TaskQueryInDto;
import cn.aitrox.ry.service.anno.dto.task.in.TaskSearchInDto;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

public interface TaskApi {

    @PostMapping(value = "/anno/task/search")
    CommonPageInfo<TaskDto> search(@RequestBody TaskSearchInDto input);

    @PostMapping(value = "/anno/task/status/edit")
    RespResult statusEdit(@RequestParam("id") Integer id, @RequestParam("status") Integer status);

    @PostMapping(value = "/anno/task")
    RespResult<TaskDto> create(@RequestBody TaskCreateInDto input);

    @PutMapping(value = "/anno/task")
    RespResult edit(@RequestBody TaskEditInDto input);

    @GetMapping(value = "/anno/task/{id}")
    TaskDetailDto read(@PathVariable("id") Integer id);

    @PostMapping(value = "/anno/task/copy")
    RespResult copy(@RequestParam("taskId") Integer taskId);

    @PostMapping(value = "/anno/task/query")
    List<TaskDto> query(@RequestBody TaskQueryInDto input);

    @PostMapping(value = "/anno/task/name/existed")
    Boolean taskNameExisted(@RequestBody TaskNameExistedInDto input);

    @PostMapping(value = "/anno/task/series")
    List<AnnoSeriesDto> taskSeries(@PathVariable("id") Integer id);
}
